# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=perl-crypt-rsa
_pkgname=Crypt-RSA
pkgver=1.99
pkgrel=17
pkgdesc='RSA public-key cryptosystem.'
arch=('any')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
depends=('perl-class-loader>=2.00' 'perl-convert-ascii-armour'
         'perl-crypt-blowfish' 'perl-crypt-cbc' 'perl-crypt-primes>=0.38'
         'perl-crypt-random>=0.34' 'perl-data-buffer' 'perl-digest-md2'
         'perl-digest-sha1' 'perl-math-pari>=2.001804' 'perl-sort-versions'
         'perl-tie-encryptedhash')
makedepends=('perl-module-install')
url='http://search.cpan.org/dist/Crypt-RSA'
source=("https://cpan.metacpan.org/authors/id/V/VI/VIPUL/$_pkgname-$pkgver.tar.gz")
sha512sums=('69426a3bd8b0d803926ac71b78952a4240831ab6202eae1d9cf1ce6f7c921e74442604f397a65f74d567629d3b2d56587aa8ca62700a458174640b02a05cff6b')
_distdir="$_pkgname-$pkgver"

build() {
  ( export PERL_MM_USE_DEFAULT=1 PERL5LIB=""                 \
      PERL_AUTOINSTALL=--skipdeps                            \
      PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'"     \
      PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \
      MODULEBUILDRC=/dev/null

    cd $_distdir

    /usr/bin/perl Makefile.PL

    make
  )
}

package() {
  cd $_distdir

  make install

  find "$pkgdir" -name .packlist -o -name perllocal.pod -delete
}

